﻿<UserControl
 x:Class="WPFExcelReport.AB50PLAN"
 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
 xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"
                    xmlns:UserControls="clr-namespace:ReflectionStudio.Components.UserControls;assembly=ReflectionStudio.Controls"
                    xmlns:Localization="clr-namespace:Localization;assembly=Localization"
 >
    <UserControl.Resources>
        <ucd:TextTrimmingConverter x:Key="Trim"></ucd:TextTrimmingConverter>
        <ucd:Divideby10  x:Key="d10"/>
        <ucd:Divideby100  x:Key="d100"/>
        <ucd:Divideby1000  x:Key="d1000"/>
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
        <ucd:String2ColorConverter  x:Key="str2color"/>
        <CollectionViewSource   x:Key="vwABAX" Source="{Binding Path=SetMaster.ICC_ABAX}" />
        <CollectionViewSource   x:Key="vwTABAX" Source="{Binding Path=SetDetail.ICC_ABAX}" /> 
    </UserControl.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition   Height="Auto" />
            <RowDefinition   Height="1*" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition  Width="1*" />
            <ColumnDefinition Width="1*" />
        </Grid.ColumnDefinitions>
        <StackPanel Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2">
            <WrapPanel>
                <Button  Height="30"  Width="30" Margin="10,0,0,0"   IsEnabled="True" Click="btnReloadABAX_Click">
                    <Button.Background>
                        <ImageBrush ImageSource="/IntexReportClient;component/Images/Reload.png" />
                    </Button.Background>
                </Button>
                <TextBlock Text="刷新"></TextBlock>
                <Button  Height="30"  Width="30" Margin="10,0,0,0"   Click="btnCombine_Click" KeyboardNavigation.TabIndex="3" IsDefault="True">
                    <Button.Background>
                        <ImageBrush ImageSource="/IntexReportClient;component/Images/Add.png" />
                    </Button.Background>
                </Button>
                <Button  Height="30"  Width="30" Margin="10,0,0,0"   Click="btnRemoveFromCombine_Click" KeyboardNavigation.TabIndex="3" IsDefault="True">
                    <Button.Background>
                        <ImageBrush ImageSource="/IntexReportClient;component/Images/button_cancel.png" />
                    </Button.Background>
                </Button>
                <TextBlock  Text="{Binding Source={Localization:Translate Word=移除}}" ></TextBlock>
                <TextBlock  Text="{Binding Source={Localization:Translate Word=合染}}" ></TextBlock>
                <Button  Height="30"  Width="30" Margin="10,0,0,0"   Click="btnSplitBatch_Click" KeyboardNavigation.TabIndex="3" IsDefault="True">
                    <Button.Background>
                        <ImageBrush ImageSource="/IntexReportClient;component/Images/Convert.png" />
                    </Button.Background>
                </Button>
                <TextBlock  Text="{Binding Source={Localization:Translate Word=分缸}}" ></TextBlock>
                
         
                <Grid Margin="20,0,0,0">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="80"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <TextBlock Grid.Column="0" Text="{Binding Source={Localization:Translate Word=数量}}" ></TextBlock>
                    <TextBox  Grid.Column="1" Name="txtTQty" Text="0" ></TextBox>
                </Grid>
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="80"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <TextBlock Grid.Column="0" Text="{Binding Source={Localization:Translate Word=交期}}" ></TextBlock>
                    <TextBox  Grid.Column="1" Name="txtDD" Text="0" ></TextBox>
                </Grid>
            </WrapPanel>
        </StackPanel>
        <DataGrid  Grid.Row="1" Grid.Column="0"
                        FontSize="12" 
                        Name="dlgABAX"
                        AutoGenerateColumns="False" 
                        EnableRowVirtualization="True" 
                        ItemsSource="{Binding Source={StaticResource ResourceKey=vwABAX}}" 
                        HeadersVisibility="Column"  CanUserReorderColumns="True" CanUserResizeRows="True" CanUserSortColumns="True" 
                       RowDetailsVisibilityMode="VisibleWhenSelected" Width="Auto"  EnableColumnVirtualization="True" 
                        HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">
            <DataGrid.Columns>
                <DataGridTextColumn Binding="{Binding Path=ABAID}" Header="{Binding Source={Localization:TranslateExtension Word=ABAID}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=ABAAUFTYP}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=ABAAUFKRS}"    Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=ABAAUFLFD}" Header="{Binding Source={Localization:TranslateExtension Word=生产单}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=ABAAUFPOS}"   Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=ABAART}" Header="{Binding Source={Localization:TranslateExtension Word=品种}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=ABAVAR}"    Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=ABAFARBE}" Header="{Binding Source={Localization:TranslateExtension Word=色号}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=ABABESCHICH}"/>
                <DataGridTextColumn Binding="{Binding Path=ABARESMG, Converter={StaticResource ResourceKey=d1000}}" Header="{Binding Source={Localization:TranslateExtension Word=KG}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=ABAVKAUFKRS}"   Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=ABAVKAUFLFD}" Header="{Binding Source={Localization:TranslateExtension Word=需求}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=ABAVKAUFPOS}"   Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=ABPART}" Header="{Binding Source={Localization:TranslateExtension Word=日期}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=ABPVAR}"    Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=ABPFARBE}" Header="{Binding Source={Localization:TranslateExtension Word=色号}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=ABAVKENDD, Converter={StaticResource ResourceKey=Trim}}" Header="{Binding Source={Localization:TranslateExtension Word=ABAVKENDD}}"  Width="Auto" />
            </DataGrid.Columns>
        </DataGrid>
        <DataGrid  Grid.Row="1" Grid.Column="1"
                        FontSize="12" 
                        Name="dlgTABAX"
                        AutoGenerateColumns="False" 
                        EnableRowVirtualization="True" 
                        ItemsSource="{Binding Source={StaticResource ResourceKey=vwTABAX}}" 
                        HeadersVisibility="Column"  CanUserReorderColumns="True" CanUserResizeRows="True" CanUserSortColumns="True" 
                       RowDetailsVisibilityMode="VisibleWhenSelected" Width="Auto"   EnableColumnVirtualization="True" 
                        HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">
            <DataGrid.Columns>
                <DataGridTextColumn Binding="{Binding Path=ABAID}" Header="{Binding Source={Localization:TranslateExtension Word=ABAID}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=ABAAUFTYP}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=ABAAUFKRS}"    Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=ABAAUFLFD}" Header="{Binding Source={Localization:TranslateExtension Word=生产单}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=ABAAUFPOS}"   Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=ABAART}" Header="{Binding Source={Localization:TranslateExtension Word=品种}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=ABAVAR}"    Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=ABAFARBE}" Header="{Binding Source={Localization:TranslateExtension Word=色号}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=ABABESCHICH}" Header="{Binding Source={Localization:TranslateExtension Word=后整理}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=ABARESMG, Converter={StaticResource ResourceKey=d1000}}" Header="{Binding Source={Localization:TranslateExtension Word=数量}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=ABAVKAUFKRS}"   Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=ABAVKAUFLFD}" Header="{Binding Source={Localization:TranslateExtension Word=需求}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=ABAVKAUFPOS}"   Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=ABPART}" Header="{Binding Source={Localization:TranslateExtension Word=日期}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=ABPVAR}"    Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=ABPFARBE}" Header="{Binding Source={Localization:TranslateExtension Word=色号}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=ABAVKENDD}" Header="{Binding Source={Localization:TranslateExtension Word=ABAVKENDD}}"  Width="Auto" />
            </DataGrid.Columns>
        </DataGrid>
        
    </Grid>
</UserControl>
